# Maintainer: Wu Zhenyu <wuzy01@qq.com>
_realname=vivid

pkgbase=mingw-w64-$_realname
pkgname=$MINGW_PACKAGE_PREFIX-$_realname
pkgver=0.8.0
pkgrel=1
pkgdesc='A themeable LS_COLORS generator with a rich filetype datebase (mingw-w64)'
arch=(any)
mingw_arch=(mingw32 mingw64 ucrt64 clang64)
url='https://github.com/sharkdp/vivid'
makedepends=($MINGW_PACKAGE_PREFIX-rust)
license=(MIT Apache)
source=("$url/archive/v$pkgver.tar.gz")
sha256sums=('e58e0936db25c81ff257775463f1d422d97c706aec2d0134e39b62151ded23cb')
b2sums=('e5820e22c384157ab9d5862c4423805ca33365164133f25bf6933b03c8f77c413e89a85934312f3b6544d414c811c67ed2374abc5ebebc65bf570010feba5571')

prepare() {
  cd vivid-$pkgver
  cargo fetch --locked
}

build() {
  cd vivid-$pkgver
  cargo build --release --locked --offline
}

package() {
  cd vivid-$pkgver
  install -Dt "$pkgdir"$MINGW_PREFIX/bin target/release/vivid
  install -Dm644 -t "$pkgdir"$MINGW_PREFIX/share/licenses/vivid LICENSE-MIT
}
